package leetcode_interview;

public class I0107 {

    //占用额外的空间
    public void rotate1(int[][] matrix) {
        int n = matrix.length;
        int[][] helpDict = new int[n][n];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                helpDict[j][n - i - 1] = matrix[i][j];
            }
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                matrix[i][j] = helpDict[i][j];
            }
        }
    }

    public void rotate(int[][] matrix) {

    }

}
